gtkwidget: Drop internal checks in grab-notify
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Jun 2020 15:23:11 +0000 (17:23 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Jun 2020 18:35:23 +0000 (20:35 +0200)
There's no need to check if the widget is already shadowed, we
implicitly have that from the signal argument.

gtk/gtkwidget.c

index af767f318a5bf6e6f1528e2ee7e273d5eb1a748a..fcd5bdec258611d75fcb07fd3baa28860d6d0691 100644 (file)
@@ -823,17 +823,12 @@ _gtk_widget_grab_notify (GtkWidget *widget,
 
   if (!priv->controllers)
     return;
+  if (was_grabbed)
+    return;
 
   for (i = (int)priv->controllers->len - 1; i >= 0; i--)
     {
       GtkEventController *controller = g_ptr_array_index (priv->controllers, i);
-      GdkDevice *device = NULL;
-
-      if (GTK_IS_GESTURE (controller))
-        device = gtk_gesture_get_device (GTK_GESTURE (controller));
-
-      if (!device || !gtk_widget_device_is_shadowed (widget, device))
-        continue;
 
       gtk_event_controller_reset (controller);
     }